package in.co.codedoc.struts;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import com.opensymphony.xwork2.util.ValueStack;

public class JSONRefTag 
	extends ComponentTagSupport
{
	@Override
	public Component getBean(ValueStack stack, HttpServletRequest req,
			HttpServletResponse res)
	{
		return new JSONRef(stack);
	}
	
	@Override
	protected void populateParams()
	{
		((JSONRef)getComponent()).setRoot(getRoot());
		((JSONRef)getComponent()).setPath(getPath());
		((JSONRef)getComponent()).setName(getName());
		super.populateParams();
	}

	public String getRoot() 
	{
		return root;
	}
	
	public void setRoot(String root)
	{
		this.root = root;
	}

	private String root;
	
	public String getPath()
	{
		return path;
	}

	public void setPath(String path)
	{
		this.path = path;
	}
	
	private String path;

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}
	
	private String name;
	
	private static final long serialVersionUID = 78548362756266L;	
}

